<?php



class VentaMapBuilder {

	
	const CLASS_NAME = 'lib.model.map.VentaMapBuilder';

	
	private $dbMap;

	
	public function isBuilt()
	{
		return ($this->dbMap !== null);
	}

	
	public function getDatabaseMap()
	{
		return $this->dbMap;
	}

	
	public function doBuild()
	{
		$this->dbMap = Propel::getDatabaseMap('propel');

		$tMap = $this->dbMap->addTable('venta');
		$tMap->setPhpName('Venta');

		$tMap->setUseIdGenerator(true);

		$tMap->addPrimaryKey('ID', 'Id', 'int', CreoleTypes::INTEGER, true, null);

		$tMap->addForeignKey('CLIENTE_ID', 'ClienteId', 'int', CreoleTypes::INTEGER, 'cliente', 'ID', false, null);

		$tMap->addColumn('SUBTOTAL', 'Subtotal', 'double', CreoleTypes::DECIMAL, true, 10);

		$tMap->addColumn('DESCUENTO', 'Descuento', 'double', CreoleTypes::DECIMAL, true, 3);

		$tMap->addColumn('TOTAL', 'Total', 'double', CreoleTypes::DECIMAL, true, 10);

		$tMap->addColumn('FECHA', 'Fecha', 'int', CreoleTypes::TIMESTAMP, true, null);

		$tMap->addColumn('TIPO', 'Tipo', 'string', CreoleTypes::CHAR, false, null);

	} 
} 